<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>后台管理系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
    <link rel="stylesheet" type="text/css" href="Styles/base.css" />
    <link rel="stylesheet" type="text/css" href="Styles/admin-all.css" />
    <link rel="stylesheet" type="text/css" href="Styles/bootstrap.min.css" />
    <script type="text/javascript" src="Scripts/jquery-1.7.2.js"></script>
    <script type="text/javascript" src="Scripts/jquery.form.js"></script>
    <script type="text/javascript" src="Scripts/jquery.spritely-0.6.js"></script>
    <script type="text/javascript" src="Scripts/chur.min.js"></script>
    <link rel="stylesheet" type="text/css" href="Styles/login.css" />
    <script type="text/javascript">
    var options = {
	    url:'userController/login',
	    type:'post',
	    clearForm:true,
	    dataType:'json',
	    success: function(result) {
	      if(result.success){
	      	location.href = 'index.jsp';
	      }else{
	          $('#codeimg').attr("src","image.jsp?dc="+Math.random());
		      $('.tip').html(result.msg);
	      }
	    }
	};
	
        $(function () {
            $('#clouds').pan({ fps: 20, speed: 0.7, dir: 'right', depth: 10 });
            $('.login').click(function () {
                if ($('#uid').val() == "" || $('#pwd').val() == "" || $('#code').val() == "") { $('.tip').html('用户名或密码不可为空！') }
                else {
                	//var queryString = $('#login').formSerialize();
                	$('form').submit();
                }
            });
            $('#codeimg').click(function () {
                $(this).attr("src","image.jsp?dc="+Math.random());
            });
            $('form').on('submit',function(){
            	$(this).ajaxSubmit(options);
            	return false;
            });
        })
    </script>
</head>
<body>
    <div id="clouds" class="stage"></div>
    <div class="loginmain">
    </div>
	<form id='login'>
    <div class="row-fluid">
        <h1>后台管理系统</h1>
        <p>
            <label>帐&nbsp;&nbsp;&nbsp;号：<input type="text" id="uid" name='name'/></label>
        </p>
        <p>
            <label>密&nbsp;&nbsp;&nbsp;码：<input type="password" id="pwd" name='pwd'/></label>
        </p>
        <p class="pcode">
            <label>验证码：<input type="text" id="code" name="randomCode" maxlength="5" class="code" /><img id='codeimg' style="margin-left:50px;" src="image.jsp" title='点击刷新' alt="" /></label>
        </p>
        <p class="tip">&nbsp;</p>
        <hr />
        <input type="button" value=" 登 录 " class="btn btn-primary btn-large login" />
        &nbsp;&nbsp;&nbsp;<input type="button" value=" 取 消 " class="btn btn-large" />
    </div>
	</form>
</body>
</html>
